package com.cp.config;

import com.cp.exception.GlobalExceptionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Des:
 * 全局异常处理
 *
 * @author XL
 * @Date 2021/9/12 18:55
 */
@Slf4j
@Configuration
public class CpGlobalExceptionAutoConfiguration {

    @Bean
    public GlobalExceptionHandler initGlobalExceptionHandle() {
        GlobalExceptionHandler globalExceptionHandle = new GlobalExceptionHandler();
        log.info("#CaptainGlobalExceptionAutoConfiguration# 全局异常处理器初始化！className：{}", "com.cp.framework.config.CaptainGlobalExceptionAutoConfiguration");
        return globalExceptionHandle;
    }
}
